﻿using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;

namespace AspireFyh.AntdWebApp.Pages.Dashboard.Analysis;

public partial class Index_razor
{
    [Inject]
    private NavigationManager NavigationManager { get; set; } = null!;
    private string? CurrentTime { get; set; }
    private readonly System.Timers.Timer _timer;
    public Index_razor()
    {
        _timer = new System.Timers.Timer(1000);
        _timer.Elapsed += TimerElapsed;
        _timer.Start();
    }
    private void TimerElapsed(object? sender, System.Timers.ElapsedEventArgs e)
    {
        CurrentTime = DateTime.Now.ToString("yyyy-M-d dddd");
    }

    private void NavigateToView()
    {
       NavigationManager.NavigateTo("/user/login");
    }
}